function distance = getDis(feature1, feature2, method)
    distance = zeros(feature1.numofobject, feature2.numofobject);
    if strcmp(method, 'bhattacharyya') == 1
        for j = 1:feature1.numofobject
            for k = 1:feature2.numofobject
                distance(j,k) = - log(sqrt(sum(feature1.Feature(j,:).*feature2.Feature(k,:))));
            end
        end
    elseif strcmp(method, 'cosdistance') == 1
        for j = 1:feature1.numofobject
            for k = 1:feature2.numofobject
                dis1 = sqrt(sum(feature1.Feature(j,:).^2));
                dis2 = sqrt(sum(feature2.Feature(k,:).^2));
                distance(j,k) = sum(feature1.Feature(j,:).*feature2.Feature(k,:))/(dis1* dis2);
            end
        end
    end
    
end